package com.zhuoshi.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zhuoshi.bean.WdHtProject;
import com.zhuoshi.bean.WdHtRoom;
import com.zhuoshi.bean.WdOpeningReport;
import com.zhuoshi.bean.WdPayType;
import com.zhuoshi.mapper.WdHtProjectMapper;
import com.zhuoshi.mapper.WdHtRoomMapper;
import com.zhuoshi.mapper.WdOpeningReportMapper;
import com.zhuoshi.mapper.WdPayTypeMapper;
import com.zhuoshi.service.OpeningQuotationService;

@Service
public class OpeningQuotationServiceImpl implements OpeningQuotationService {
	
	@Autowired
	private WdOpeningReportMapper openingDao;
	@Autowired
	private WdHtProjectMapper projectDao;
	@Autowired
	private WdHtRoomMapper roomDao;
	@Autowired
	private WdPayTypeMapper payDao;

	public List<WdHtProject> selectProject() {
		List<WdHtProject> list = projectDao.selectAll(null);
		return list;
	}

	public void addOpening(WdOpeningReport open) {
		openingDao.insertSelective(open);
		
	}

	public WdHtProject selectProjectById(String projectid) {
		WdHtProject project = projectDao.selectByPrimaryKey(projectid);
		return project;
	}

	public List<WdHtRoom> selectRoomInOpen(String openId) {
		List<WdHtRoom> list = roomDao.selectRoomInOpen(openId);
		return list;
	}

	public List<WdHtRoom> selectRoomNotInOpen() {
		List<WdHtRoom> roomNotInOpen = roomDao.selectRoomNotInOpen();
		return roomNotInOpen;
	}

	public void addRoomInOpen(WdHtRoom room) {
		roomDao.addRoomInOpen(room);
	}

	public void addAllRoomInOpen(String openId) {
		roomDao.addAllRoomInOpen(openId);
	}
	public void removeRoomInOpen(WdHtRoom room) {
		roomDao.removeRoomInOpen(room);
	}

	public void removeAllRoomInOpen(String openId) {
		roomDao.removeAllRoomInOpen(openId);
	}

	public WdOpeningReport selectOpenById(String openId) {
		return openingDao.selectByPrimaryKey(openId);
	}

	public void updateOpen(WdOpeningReport open) {
		openingDao.updateByPrimaryKeySelective(open);
	}

	public List<WdPayType> selectPayType() {
		List<WdPayType> list = payDao.findAll();
		return list;
	}

	public WdPayType selectPayTypeById(String payTypeId) {
		WdPayType payType = payDao.findById(payTypeId);
		return payType;
	}
	
    
	
}
